package com.example.ruiji.controller.arch;

import com.example.ruiji.service.article.ArticleServiceImpl;
import com.example.ruiji.utils.vo.Result;
import com.example.ruiji.utils.vo.param.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Author:BaiYiChen
 * Date:2022/5/2 14:56
 *
 * @author BaiYiChen
 */
@RestController
@RequestMapping("/arch")
public class ArchRestController {
  @Autowired
  private ArticleServiceImpl articleService;
  
  @PostMapping("/cnt")
  public Result archCnt(@RequestParam("date")String date){
    Long count = articleService.listArticleCountByDate(date);
    return Result.successful(count);
  }
  @PostMapping("/showArch")
  public Result showArch(@RequestParam("date")String date,PageParam param){
    Result result = articleService.findByDate(param, date);
    return result;
  }
}
